diff options
| author | real-zephex <[email protected]> | 2024-04-02 22:41:19 +0530 |
|---|---|---|
| committer | real-zephex <[email protected]> | 2024-04-02 22:41:19 +0530 |
| commit | 794cb6236fa256f8074c56f372eba05526e7c066 (patch) | |
| tree | 4d53c0977894bc2939e430e930fd9f6dda6ec0e5 /src/app/anime/[id]/[animeId] | |
| parent | fixes: minor css modifications, added basic information about the last read m... (diff) | |
| download | dramalama-794cb6236fa256f8074c56f372eba05526e7c066.tar.xz dramalama-794cb6236fa256f8074c56f372eba05526e7c066.zip | |
UI Upgrades for anime section.
Diffstat (limited to 'src/app/anime/[id]/[animeId]')
| -rw-r--r-- | src/app/anime/[id]/[animeId]/page.jsx | 56 | ||||
| -rw-r--r-- | src/app/anime/[id]/[animeId]/video.css | 24 |
2 files changed, 0 insertions, 80 deletions
diff --git a/src/app/anime/[id]/[animeId]/page.jsx b/src/app/anime/[id]/[animeId]/page.jsx deleted file mode 100644 index 1614775..0000000 --- a/src/app/anime/[id]/[animeId]/page.jsx +++ /dev/null @@ -1,56 +0,0 @@ -import { MediaPlayer, MediaProvider } from "@vidstack/react"; -import "@vidstack/react/player/styles/base.css"; -import "@vidstack/react/player/styles/plyr/theme.css"; -import { - PlyrLayout, - plyrLayoutIcons, -} from "@vidstack/react/player/layouts/plyr"; -import "./video.css"; -import { redirect } from "next/navigation"; - -export default async function Video({ params }) { - const id = params.animeId; - - // Getting the episode number and the anime name. Kindly ignore! - const words = id.split("-"); - const last_two = words.slice(-2).join(" "); - const remainingWords = words.slice(0, -2).join(" "); - - const data = await getVideoLink(id); - - if (data.message) { - redirect("/404"); - } - - const link = data.sources[4].url; - - return ( - <div> - <div className="video2"> - <p> - {last_two} - {remainingWords} - </p> - <MediaPlayer - title={words} - src={link} - className="testPlayer" - playsInline - aspectRatio="16/9" - load="eager" - > - <MediaProvider /> - <PlyrLayout icons={plyrLayoutIcons} /> - </MediaPlayer> - </div> - </div> - ); -} - -async function getVideoLink(id) { - const res = await fetch( - "https://consumet-api-di2e.onrender.com/anime/gogoanime/watch/" + id, - { next: { revalidate: 7200 } } // Video links are revalidated after an hour - ); - const data = res.json(); - return data; -} diff --git a/src/app/anime/[id]/[animeId]/video.css b/src/app/anime/[id]/[animeId]/video.css deleted file mode 100644 index 40f6e8e..0000000 --- a/src/app/anime/[id]/[animeId]/video.css +++ /dev/null @@ -1,24 +0,0 @@ -.video2 { - display: flex; - flex-direction: column; - align-items: center; - margin: 0px auto; - width: 50%; -} - -.testPlayer { - border-radius: 10px; -} - -.video2 p { - color: white; - font-family: "Lato"; - font-size: 20px; - text-align: center; -} - -@media screen and (max-width: 768px) { - .video2 { - width: 100%; - } -}
\ No newline at end of file |